# -*- coding: utf-8 -*-
#  @Time    : 2020/2/23 23:03
#  @Author  : Ben
#  @File    : service.py
from accessories.models import Accessories
class AccessoriesService:
    def select_accessories(self,name):
        """
        搜索配件信息Service
        :param name:
        :return: QuerySet
        """
        try:
            accessories=Accessories.accessories.filter(name=name)
            print(accessories)
            print("查询成功")
            return accessories
        except Exception:
            print("查询的信息不存在，查询失败")
            return None


